﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TMIS.DAL
{
    public class Identify
    {
        private Model.ThesisDB db = new Model.ThesisDB();
        /// <summary>
        /// 获取指定ID号对应的实习鉴定表
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        public Model.Identify Get(Guid guid)
        {
            Model.Identify ide = db.Identify.FirstOrDefault(e => e.ID == guid);
            return ide;
        }
        /// <summary>
        /// 更新鉴定表信息
        /// </summary>
        /// <param name="ide"></param>
        public void Update(Model.Identify ide)
        {
            Model.Identify iden = db.Identify.FirstOrDefault(e => e.ID == ide.ID);
            iden.TeacherID = ide.TeacherID;
            iden.Location = ide.Location;
            iden.Date = ide.Date;
            iden.Opinion = ide.Opinion;
            db.SubmitChanges();
        }
        /// <summary>
        /// 生成新的实习鉴定表
        /// </summary>
        /// <param name="identify"></param>
        public void Insert(Model.Identify identify)
        {
            db.Identify.InsertOnSubmit(identify);
            db.SubmitChanges();
        }
    }
}
